from todo_api_project.base.myBase import Tools


class reg_model(Tools):
    # 定义路径
    path = '/user/register'

    # 发送注册请求
    def reg_action(self, usr, pwd, cpwd, email, check='1234'):
        mydata = {
            'username': usr,
            'password': pwd,
            'cpassword': cpwd,
            'checkcode': check,
            'email': email
        }
        res = self.session.post(url=self.hosturl+self.path, data=mydata)
        return res.json()

